package com.lhczf.lucenedb.bean;

import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.time.format.DateTimeFormatter;

/**
 * @author: 刘华春
 * @date: 2019/2/6
 */
@Getter
@Setter
@Component
public class SystemConfig {

    public static final String LOCAL_FILE_DATA = "localFile";
    public static final String KAFKA_DATA = "kafka";
    public static final DateTimeFormatter Y_M_D_DTF = DateTimeFormatter.ofPattern("yyyyMMdd");
    public static final String INDEX_DAYS_DIR = "days";
    public static final String ALL_INDEXS_DIR = "other";
    public static final String INDEX_RECOVER_DIR = "recover";
    public static final String INDEX_DIR_NAME = "index";
    public static final String TAXONOMY_DIR_NAME = "taxonomy";
    public static final String INDEX_NAME_KEY = "index_name_key";
    public static final String INDEX_CONFIG_KEY = "config";
    public static final String INDEX_PROPERTIES_KEY = "properties";

    @Value("${luceneDB.production.class}")
    private String dataProductionClass;

    @Value("${luceneDB.consumer.class}")
    private String dataConsumerClass;

    @Value("${luceneDB.consumer.lucene.ram}")
    private int luceneRam;

    @Value("${luceneDB.production.batch}")
    private Integer batch;

    @Value("${luceneDB.performance.debug}")
    private boolean performanceDebug;

    @Value("${luceneDB.indexData}")
    private String indexData;

    @Value("${luceneDB.backup.dir}")
    private String backupData;

    @Value("${luceneDB.backup.timeOut}")
    private int timeOut;

    @Value("${luceneDB.backup.period}")
    private int backUpPeriod;

    @Value("${luceneDB.clean.period}")
    private int cleanPeriod;
}
